package com.ykht.proj.coupon.Enum;

/**
 * @Author: lazyBoy
 * @Date: 2021/3/10 14:24
 */
public enum PostStatusEnum {
//	CMS_TYPE_1(1,"草稿"),
//	CMS_TYPE_2(2,"草稿定时发布"),
//	CMS_TYPE_3(3,"已发布"),
//	CMS_TYPE_4(4,"已提交"),
//	CMS_TYPE_5(5,"已审核"),
//	CMS_TYPE_6(6,"审核失败"),
//	CMS_TYPE_7(7,"下架"),
//	CMS_TYPE_8(8,"已推送");
	POST_STATUS_1(1,"-"),
	POST_STATUS_2(2,"-"),
	POST_STATUS_3(3,"下架"),
	POST_STATUS_4(4,"审核"),
	POST_STATUS_5(5,"发布"),
	POST_STATUS_6(6,"-"),
	POST_STATUS_7(7,"发布");
	/**
	 * 数值
	 */
	private Integer value;
	/**
	 * 描述
	 */
	private String desc;

	private PostStatusEnum(Integer value, String desc) {
		this.value = value;
		this.desc = desc;
	}


	/**
	 * 根据val值获取desc
	 * @param val 1、0
	 * @return
	 */
	public static String getDescByVal(Integer val) {
		PostStatusEnum[] values = PostStatusEnum.values();
		for (PostStatusEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe.getDesc();
			}
		}
		return null;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
